To use the applet one must download the code and place it in the same directory as the .html document in which the puzzle is to appear. NOTE: you will also need to download the following two classes which may also be found in the public ftp directory: DarkFilter.class and BrightFilter.class
Next, in the actual HTML code of the documentation the following lines should be added:
The param tags are the lines which customize the applet to your needs. Following is a list of all the parameter options which are currently applicable. Note that the 'name=' of the parameter as typed into the HTML document SHOULD BE CAPITALIZED... it is not necessary to capitalize the 'value' attributes. Defaults (where described) indicate what appropriate values will be used if not explicitly given in the HTML document.
The IMAGE parameter's value should be the name of the image you wish to place in the puzzle. The file name should include the relative directory path from the directory of the HTML document. If the image is not square, it will be cropped to the largest square which is evenly divisible by the GRID value (see next). Images may be either .gif or .jpg format.
The GRID parameter indicates the number of pieces which should be in the puzzle by assigning the number of 'tiles' in each row. For exmaple, a vlaue=4 would generate a 4x4 sliding puzzle game. It is recommended that you not use a GRID value over 4 or 5, since it will take longer for the puzzle to be generated (the Image filters tax the machine). The GRID value must be at least 2.
The SOUND parameter provides a noise which is echoed when the pieces are moved. If no value is given, no noise is made. The sound used in the example above may be used freely. It is located in the at: ftp://xm.com/pub/incoming/cafe/sounds/click.au.
-- Comments and suggestions are welcome: harshec@cdware.eng.sun.com, address Eric Harshbarger
© Copyright 1996, Sun Microsystems